DXL Script Performance - Issue with BIG Module

Hi All,

Can someone help me to fix the performance issue of the script attached? This script takes more than 9 hours to execute in a medium level modules 1400 Objects. Thanks for your help in Advance....

Note:

Eg: Module1 <- Module 2 <- Module 3 <- Module 4 <- Module 5 <- Module 6.

I have to run this code from the Module 6. I will provide the Module1 Name as input parameter in my script. so, my code should traverse all the way till the end (Module 1), If there is a link from Module 6 to Module 1...... Then I will create an attribute in Module 6 & Insert the value "X"... Then go to next Object start testing again....

Regards,
Muruga.
SystemAdmin - Wed Oct 14 19:24:19 EDT 2009

Re: DXL Script Performance - Issue with BIG Module
Lee_Bost - Thu Oct 15 10:28:50 EDT 2009

You might try checking to see if the module is open before trying to use the read or edit commands. It is my understanding that each time you use the read/edit command it tries to open the module. If the module is already open then there is no need to do this. You can just set your module variable to that module. You can do something like the following:
 

if (open module targetFullName)
{
   t3 = module item targetFullName3
}
else
{
   t3 = edit(targetFullName3)
}

 


Also, I would just open all of the modules using edit. This will eliminate the need to open it for read and then reopening it for edit later.

 

Re: DXL Script Performance - Issue with BIG Module
dpechacek - Fri Oct 16 07:13:19 EDT 2009

First off, get rid of print statements. They slow things down. Especially if there's a lot of them. Use a log file if you need a record of what happens.

I also see you creating a lot of strings you just use to output some information. Accessing values in an object slows things down. Change to using object IDs since its faster. It also doesn't build as big a string table as I'm sure Object Text is larger than the ID most of the time. Or just get rid of this altogether. If you want them, declare a global Buffer and use it for the whole script. Use tempStringOf() in your prints/log file to avoid building the string table any more than you have to.

AAI Services, Textron
dpechacek@aai.textron.com
David.Pechacek@gmail.com